package cn.boysoft.module.security.model.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import cn.boysoft.core.annotation.JEEEntityDeclare;
import cn.boysoft.core.model.entity.BaseEntity;

@Table(name = "jee_menu")
@Entity
@JEEEntityDeclare(name = "菜单")
public class MenuEntity extends  BaseEntity{
	@Column(length = 36)
	private String name;
	@ManyToOne
	@JoinColumn(name="userId" ,nullable = false)
	private UserEntity user;
	@ManyToOne
	@JoinColumn(name="resourceId" ,nullable = false)
	private  ResourceEntity resource;
	@ManyToOne
	@JoinColumn(name="parentId")
	private MenuEntity parent;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public UserEntity getUser() {
		return user;
	}
	public void setUser(UserEntity user) {
		this.user = user;
	}
	public ResourceEntity getResource() {
		return resource;
	}
	public void setResource(ResourceEntity resource) {
		this.resource = resource;
	}
	public MenuEntity getParent() {
		return parent;
	}
	public void setParent(MenuEntity parent) {
		this.parent = parent;
	}
	
}
